<template>
    <div class="center1">
        <section class="cards">
            <div class="card card__1">
                <p class="title">服务经销商总数量</p>
                <span class="value">{{ randValue(5000) }}<span class="unti">家</span></span>
            </div>
            <div class="card card__2">
                <div class="top">
                    <p class="title">车险出单量</p>
                    <span class="value">{{ randValue(50000) }}<span class="unti">单</span></span>
                </div>
                <div class="bottom">
                    <div class="title">
                        <span>在线单量</span>
                        <span>OCR</span>
                    </div>
                    <div class="value">
                        <span>{{ randValue(2000) }}</span>
                        <span>{{ randValue(2000) }}</span>
                    </div>
                </div> 
            </div>
            <div class="card card__3">
                <div class="top">
                    <p class="title">总保费</p>
                    <span class="value">{{ randValue(10000) }}<span class="unti">万元</span></span>
                </div>
                <div class="bottom">
                    <div class="title">
                        <span>在线单量</span>
                        <span>OCR</span>
                    </div>
                    <div class="value">
                        <span>{{ randValue(2000) }}</span>
                        <span>{{ randValue(2000) }}</span>
                    </div>
                </div>
            </div>
            <div class="card card__4">
                <p class="title">服务包销量</p>
                <span class="value">{{ randValue(10000) }}<span class="unti">单</span></span>
            </div>
            <div class="card card__5">
                <p class="title">服务包销售额</p>
                <span class="value">{{ randValue(1000) }}<span class="unti">万元</span></span>
            </div>

        </section>
    </div>
</template>

<script setup>
import { ref } from 'vue'
//随机数据
const randValue= (number=100) => {
  return Math.round(Math.random() * number)
}
</script>

<style lang="scss" scoped>
$color-border:#494949;
$color-green:#57f13c;
.center1{
    // width: 100px;
    height: 8.6rem;
    margin-top: 2.4rem;
    margin-right: -10rem;
    
    display: flex;
    justify-content: space-around;

}
.cards{
    display: flex;
    width: 100%;
    // border: 1px solid;
}
.card{
    flex: 1;
    height: 100%;
    border-top: 1px solid $color-border;
    border-bottom: 1px solid $color-border;
    background-color: rgba(0,0,0,0.2);
    margin-right: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    letter-spacing: 1px;
    &:nth-last-child(1){
        margin-right: 0;
    }
    .title{
            font-size: 1.4rem;
            font-weight: 100;
            margin-top: 2px;
        }
    .value{
        font-size: 2rem;
        color:$color-green;
    }
    .unti{
        font-size: 1.4rem;
        color:#fff;
    }
    &__1,&__4,&__5{
        height: 5.6rem
    }
    &__2,&__3{
        .top{
            height: 5.6rem
        }
        .bottom{
            width: 100%;
            padding: 0 5px;
            .title{
                display: flex;
                justify-content: space-between;
                font-size: 1.2rem;
            }
            .value{
                display: flex;
                justify-content: space-between;
                font-size: 1.4rem;
            }
        }
    }
}

</style>